Closes petercorke#150
LabelMeReader.__init__ used to wrap file/JSON/URL loading in a broad
try/except that swallowed OSError, json.JSONDecodeError, TypeError and
ValueError and returned None, leaving a half-initialised reader whose
callers only failed later with a confusing error. The original exception
now propagates with its message and traceback.
Scoped to this single quick-win item from petercorke#150; the other items in that
umbrella issue are left for separate PRs.
Signed-off-by: agentops <agentops@users.noreply.github.com>
修复内容 / What this fixes
Closes #150
LabelMeReader.__init__原先把文件/JSON/URL 读取包在一个宽泛的try/except里,吞掉
OSError、json.JSONDecodeError、TypeError、ValueError后return None,留下一个半初始化的 reader,调用方要到很晚才会以一个莫名其妙的错误失败。
现在原始异常直接抛出,带原始信息和 traceback —— 正是这个 issue 要求的行为。
实现思路 / Approach
去掉这层
try/except,让加载阶段的原始异常自然传播。不引入新的异常类型、不改公共 API。改动范围仅限 #150 中这一个 quick-win 项,其余项留给独立 PR。
验证 / Verification
(skipped 的用例需要 ROS / 视频文件等本地不具备的环境。)
备注 / Notes
本 PR 由自动化流水线准备:提交前经过语法检查与自审,未触碰无关代码。